package net.tngou.db.util;



import java.io.IOException;


/**
 * 对象序列化工具包
 *
 * @author winterlau
 */
public class SerializationUtils {

   
    private static Serializer g_ser;

    public static void main(String[] args) throws IOException {
        
    	ResultSet obj = new ResultSet();
    	obj.setMsg("陈磊");
		byte[] by = SerializationUtils.serialize(obj );
		System.err.println(by.length);
    }

    static {
       
           g_ser = new FSTSerializer();
      
    }

    public static byte[] serialize(Object obj) throws IOException {
        return g_ser.serialize(obj);
    }

    public static Object deserialize(byte[] bytes) throws IOException {
        return g_ser.deserialize(bytes);
    }

}
